$(function(){
	$('#bleed_btn').click(function(){
		ajax_send_request(1,this);
	});

	$('#B_btn').click(function(){
		ajax_send_request(5,this);
	});

	$('#X_btn').click(function(){
		ajax_send_request(3,this);
	});

	//
	function ajax_send_request(lab_type,obj)
	{
		$(obj).addClass('disabled');
		$(obj).html('数据获取中......');
		
		var url = $('#base_url').val()+"admin/data_sync_request/";
		
		$.post(url,{hospital_id:$('#hospital_id').val().trim(),lab_type:lab_type},
			function(data) {
				$(obj).removeClass('disabled');
				$(obj).html('数据获取');
				eval("data="+data);
				alert(data.msg);
				
				if(data.code == 1)
				{
					//TODO:refresh the page
					location.reload();
				}	
		});
	}

});